package Beans;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Repository;

import javax.validation.constraints.Pattern;

/**
 * student
 * @author 
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
    /**
     * 学生id
     */
    private Integer studentId;

    /**
     * 学生姓名
     */
    @Pattern(regexp ="(^[a-zA-Z0-9_-]{1,16}$)|(^[\\u2E80-\\u9FFF]{1,10})" ,message ="用户名格式错误")
    private String studentName;

    /**
     * 学生班级
     */
    @Pattern(regexp ="^[0-9]{1,16}$" ,message ="班级格式错误")
    private Integer studentClass;

    /**
     * 学生年级
     */
    @Pattern(regexp ="^[0-9]{1,16}$" ,message ="年级格式错误")
    private Integer studentGrade;

    private static final long serialVersionUID = 1L;

    public Student( String studentName, Integer studentClass, Integer studentGrade) {
        this.studentName = studentName;
        this.studentClass = studentClass;
        this.studentGrade = studentGrade;
    }
}